<template>
    <div>
        <Table :columns="columns" border :data="data" row-key="id" >
            <template slot-scope="{ row }" slot="operation">
                <strong>
                    <a @click="handleCostDetail">{{ row.operation }}</a>
                </strong>
            </template>
        </Table>
        <cost-record ref="costRecord" />
    </div>
</template>
<script>
    import costRecord from '@/components/costRecord';
    export default {
        components: { costRecord },
        data () {
            return {
                modal: false,
                columns: [
                    {
                        title: '项目名称',
                        key: 'name'
                    },
                    {
                        title: '单位',
                        key: 'unit'
                    },
                    {
                        title: '数量',
                        key: 'number'
                    },
                    {
                        title: '费用金额',
                        key: 'price'
                    },
                    {
                        title: '折后金额',
                        key: 'discount'
                    },
                    {
                        title: '操作 ',
                        slot: 'operation'
                    }
                ],
                data: [
                    {
                        name: '308',
                        unit: '个',
                        number: 51,
                        price: '536.00 ',
                        discount: '336.00',
                        operation: '详细'
                    },
                    {
                        name: '药浴',
                        unit: '次',
                        number: 5,
                        price: '936.00 ',
                        discount: '936.00',
                        operation: '详细'
                    },
                    {
                        name: '药品',
                        unit: '/',
                        number: 168,
                        price: '3936.00 ',
                        discount: '2936.00',
                        operation: '详细'
                    }
                ],
                columns1: [
                    {
                        title: '名称',
                        key: 'name'
                    },
                    {
                        title: '数量',
                        key: 'number',
                        width: 80
                    },
                    {
                        title: '单位',
                        key: 'company',
                        width: 80
                    },
                    {
                        title: '类型',
                        key: 'type',
                        width: 118
                    },
                    {
                        title: '单价 ',
                        key: 'unitPrice'
                    },
                    {
                        title: '金额 ',
                        key: 'moeny'
                    },
                    {
                        title: '折后金额',
                        key: 'AfterFolding'
                    }
                ],
                data1: [
                    {
                        name: '驱虫斑鸠菊注射液 ',
                        number: 2,
                        company: '支',
                        type: '药品',
                        unitPrice: '18.00 ',
                        moeny: '36.00',
                        AfterFolding: '36.00'
                    },
                    {
                        name: '驱虫斑鸠菊注射液 ',
                        number: 2,
                        company: '支',
                        type: '药品',
                        unitPrice: '18.00 ',
                        moeny: '36.00',
                        AfterFolding: '36.00'
                    }
                ]
            }
        },
        methods: {
            handleCostDetail () {
                this.$refs.costRecord.handleCostDetail()
            }
        }
    }
</script>
<style scoped>
.order-inr {
    padding: 20px;
}
.order-inr strong {
    font-size: 16px;
    font-weight: bold;
    margin-right: 30px;
}
</style>
